package com.guo.book1.singleduty;

public class Test {
    public static void main(String[] args) {
        ICourse course = JavaDiscountCourse
                .builder()
                .name("Java设计模式")
                .price(50D)
                .quantity(2)
                .build();

//        ICourse course = new JavaDiscountCourse("Java进阶实战", 100D, 3);
        System.out.println("course.getPrice() = " + course.getPrice());

        JavaDiscountCourse javaDiscountCourse = (JavaDiscountCourse)course;
        System.out.println("原价： " + javaDiscountCourse.getPrice());
        System.out.println("折扣价： " + javaDiscountCourse.getDiscountPrice());
    }
}
